From 62b69655472a0ffed410867fa7142e0ebdfff937 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Thu, 1 Oct 2009 15:40:13 +0000 Subject: [PATCH] * net/tramp-smb.el (tramp-smb-errors): Add error message for connection timeout. (tramp-smb-handle-delete-directory): Handle optional parameter RECURSIVE. --- lisp/net/tramp-smb.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 549001db75a..54835efe226 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -87,6 +87,7 @@ "NT_STATUS_ACCOUNT_LOCKED_OUT" "NT_STATUS_BAD_NETWORK_NAME" "NT_STATUS_CANNOT_DELETE" + "NT_STATUS_CONNECTION_REFUSED" "NT_STATUS_DIRECTORY_NOT_EMPTY" "NT_STATUS_DUPLICATE_NAME" "NT_STATUS_FILE_IS_A_DIRECTORY" @@ -248,10 +249,19 @@ PRESERVE-UID-GID is completely ignored." v 0 "Copying file %s to file %s...done" filename newname) (tramp-error v 'file-error "Cannot copy `%s'" filename))))))) -(defun tramp-smb-handle-delete-directory (directory) +(defun tramp-smb-handle-delete-directory (directory &optional recursive) "Like `delete-directory' for Tramp files." (setq directory (directory-file-name (expand-file-name directory))) (when (file-exists-p directory) + (if recursive + (mapc + (lambda (file) + (if (file-directory-p file) + (delete-directory file recursive) + (delete-file file))) + ;; We do not want to delete "." and "..". + (directory-files + directory 'full "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"))) (with-parsed-tramp-file-name directory nil ;; We must also flush the cache of the directory, because ;; file-attributes reads the values from there. -- 2.30.2